package com.coders.vimek.Javatutorials;

public class JavaSingletonDesignPatternBaseExample {

	private static JavaSingletonDesignPatternBaseExample objjj = new JavaSingletonDesignPatternBaseExample();

	public  void display()
	{
		//we call this display() from JavaSingletonDesignPatternCallFromOtherClassExample class..using the 
		// getObj() function
		System.out.println("This is the display() inside the JavaSingletonDesignPatternBaseExample class ");
		
	}
	private JavaSingletonDesignPatternBaseExample()
	{
		// if a constructor is made private . we canot intilizze the class JavaSingletonDesignPatternBaseExample
		//in other class
		// that means we cannot create an object of JavaSingletonDesignPatternBaseExample in other class
		//so we write a public static function to share the object
		
		
	}
	//public static JavaSingletonDesignPatternBaseExample getObj()
//	{
	//	return objjj;
	//}
	public static JavaSingletonDesignPatternBaseExample getObj() {
		// TODO Auto-generated method stub
		return objjj;
	}
}
